<template>
  <div class="wrapper">
    <swiper :options="swiperOption">
      <!-- slides -->
      <swiper-slide v-for="item of list" :key="item.id">
        <router-link to="/#">
         <img :src="item.imgUrl" class="swiper-img" :alt="item.id" />
        </router-link>
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'carrousel',
  props: { // 子组件接收父组件传递的参数
    list: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination'
      }
    }
  }
}
</script>

<style>
.swiper-pagination-bullet-active {
  background-color: #fff;
}
</style>

<style lang="less" scoped>
.swiper-img {
  width: 100%;
  height: 100%;
}
</style>
